<?php 
$nullMessage='<span class="null">'.Yii::t('zii','Not set').'</span>';
$formatter=Yii::app()->format;
?>
<div class="loan-view <?php echo ($data->dischargeDate)?'loan-view-discharged':''; ?>">

<!-- Total span is 22  -->

<!-- Deal -->
<div class="span-4">
Deal:
</div>
<div class="span-5">
<?php
	if($data->dealId != null)
		echo CHtml::link(CHtml::encode($data->deal->referenceNo), array('deal/view', 'id'=>$data->dealId),array('class'=>'icon icon-zoom'));
?>
</div>

<!-- Team -->
<div class="span-6">
	<?php if($data->dealId != null) echo CHtml::encode($data->deal->team->name); ?>
</div>

<!-- Discharge Date -->
<?php if($data->dischargeDate):?>
	<div class="loan-discharged-highlight span-7">
	Discharged on <?php echo $data->dischargeDate; ?>
	</div>
<?php endif; ?>

<div class="clear"></div>

<!-- Bank -->
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('bank')); ?>:</div>
<div class="span-5">
	<?php 
	if($data->dealId != null)
		echo CHtml::link(CHtml::encode($data->deal->bank), array('loan/view','id'=>$data->id),array('class'=>'icon icon-zoom'));
	else
		echo CHtml::link(CHtml::encode($data->bank), array('loan/view','id'=>$data->id),array('class'=>'icon icon-zoom'));
	 ?>
</div>

<!-- Amount -->
<div class="span-3"><?php echo CHtml::encode($data->getAttributeLabel('amount')); ?>:</div>
<div class="span-3">
	<?php echo number_format($data->amount,2,$formatter->numberFormat['decimalSeparator'],$formatter->numberFormat['thousandSeparator']); ?>
</div>

<!-- Rate -->
<div class="span-3"><?php echo CHtml::encode($data->getAttributeLabel('rate')); ?>:</div>
<div class="span-3">
	<?php echo number_format($data->rate,4,$formatter->numberFormat['decimalSeparator'],$formatter->numberFormat['thousandSeparator']); ?>
</div>

<div class="clear"></div>

<!-- Product Name -->
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('productName')); ?>:</div>
<div class="span-5">
	<?php echo $data->productName?CHtml::encode($data->productName):$nullMessage; ?>
</div>

<!-- Settlement Date -->
<div class="span-3">Settle Date<?php //echo CHtml::encode($data->getAttributeLabel('settlementDate')); ?>:</div>
<div class="span-3">
	<?php echo $data->settlementDate?CHtml::encode($data->settlementDate):$nullMessage; ?>
</div>

<!-- Pricing -->
<div class="span-3"><?php echo CHtml::encode($data->getAttributeLabel('pricing')); ?>:</div>
<div class="span-3">
	<?php echo $data->pricing?CHtml::encode($data->pricing):$nullMessage; ?>
</div>

<div class="clear"></div>

<!-- Honeymoon Date -->
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('honeymoonDate')); ?>:</div>
<div class="span-5">
	<?php echo $data->honeymoonDate?CHtml::encode($data->honeymoonDate):$nullMessage; ?>
</div>

<!-- Create Date -->
<div class="span-3"><?php echo CHtml::encode($data->getAttributeLabel('createDate')); ?>:</div>
<div class="span-9">
	<?php echo $data->createDate?CHtml::encode($data->createDate):$nullMessage; ?>
</div>

<div class="clear"></div>

<!-- Commision Paid -->
<div class="span-4"><?php echo CHtml::encode($data->getAttributeLabel('commissionPaid')); ?>:</div>
<div class="span-5">
	<?php //echo DataUtil::getOptionYesNo($data->commissionPaid); 
		echo ($data->commissionPaid == 0) ? 'No': 'Yes';
	?>
</div>
<div class="clear"></div>

	<?php /*
	<b><?php echo CHtml::encode($data->getAttributeLabel('honeymoonDate')); ?>:</b>
	<?php echo CHtml::encode($data->honeymoonDate); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('dischargeDate')); ?>:</b>
	<?php echo CHtml::encode($data->dischargeDate); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('securityAddress')); ?>:</b>
	<?php echo CHtml::encode($data->securityAddress); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('securitySuburb')); ?>:</b>
	<?php echo CHtml::encode($data->securitySuburb); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('securityPostcode')); ?>:</b>
	<?php echo CHtml::encode($data->securityPostcode); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('securityState')); ?>:</b>
	<?php echo CHtml::encode($data->securityState); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('securityCountry')); ?>:</b>
	<?php echo CHtml::encode($data->securityCountry); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('createDate')); ?>:</b>
	<?php echo CHtml::encode($data->createDate); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('commissionPaid')); ?>:</b>
	<?php echo CHtml::encode($data->commissionPaid); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('note')); ?>:</b>
	<?php echo CHtml::encode($data->note); ?>
	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('customerId')); ?>:</b>
	<?php echo CHtml::encode($data->customerId); ?>
	<br />

	*/ ?>

</div>